package crp.extensions.xjtu.sso;


import org.eclipse.microprofile.rest.client.inject.RegisterRestClient;
import org.jboss.resteasy.annotations.jaxrs.HeaderParam;
import org.jboss.resteasy.annotations.jaxrs.QueryParam;

import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

@Path("/openplatform/oauth")
@RegisterRestClient(configKey = "xjtu.sso.sso-sdk")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public interface XJTUSSORestClient {
    @GET
    @Path("/getAccessToken")
    String getAccessToken(@QueryParam("code") String code);

    @GET
    @Path("/open/getUserInfo")
    String getUserInfo(@HeaderParam("X-Access-Token") String accessToken);
}
